# Maintainer: Rémy Oudompheng <remy@archlinux.org>

pkgname='perl-perlio-utf8-strict'
_dist=PerlIO-utf8_strict
pkgver=0.007
pkgrel=7
pkgdesc="Fast and correct UTF-8 PerlIO"
arch=('i686' 'x86_64')
license=('PerlArtistic' 'GPL')
options=('!emptydirs')
depends=('perl')
makedepends=('perl-test-exception')
url="https://metacpan.org/release/${_dist}"
source=(https://search.cpan.org/CPAN/authors/id/L/LE/LEONT/${_dist}-${pkgver}.tar.gz)
md5sums=('9e8fba7f15c612c4f2ed2f961bf1141b')
sha256sums=('83a33f2fe046cb3ad6afc80790635a423e2c7c6854afacc6998cd46951cc81cb')

build() {
    cd "${srcdir}/${_dist}-${pkgver}"
    unset PERL5LIB PERL_MM_OPT PERL_MB_OPT PERL_LOCAL_LIB_ROOT
    export PERL_MM_USE_DEFAULT=1 PERL_AUTOINSTALL=--skipdeps
    perl Makefile.PL
    make
}

check() {
    cd "${srcdir}/${_dist}-${pkgver}"
    unset PERL5LIB PERL_MM_OPT PERL_MB_OPT PERL_LOCAL_LIB_ROOT
    export PERL_MM_USE_DEFAULT=1
    make test
}

package() {
    cd "${srcdir}/${_dist}-${pkgver}"
    unset PERL5LIB PERL_MM_OPT PERL_MB_OPT PERL_LOCAL_LIB_ROOT
    make install INSTALLDIRS=vendor DESTDIR="$pkgdir"
}
